package tp.pr2;

public class ItemContainer {
	private Item []listaItem;
	private int numItem;
	
	public boolean addItem(Item item){
		boolean success = true;
		for (int i = 0; i< numItem; i++){
			if (listaItem[i].getId().compareTo(item.getId()) == 0) {
				success = false; 
				break;
			}
			if (listaItem[i].getId().compareTo(item.getId()) == 1){
				for (int j = numItem; i < j; j--){
					listaItem[j] = listaItem[j-1];
				}
				listaItem[i] = item;
				numItem++;
				success = true;
				break;
			}
		}
		return success;
	}
	
	/*public Item getItem(String id){
		// implementar busqueda binaria
		return new Item();
	}
	public Item pickItem (String id){
		
	}*/
}
